import 'package:dio/dio.dart';
import 'package:sainbainu/common/http/http.dart';

class UserApi {
  /// 关注列表
  Future<Map<String, dynamic>> followList(
    Map<String, dynamic> params,
  ) async {
    Response res = await Http.get(
      '/api/customer/follow/list',
      params: params,
    );
    return res.data;
  }

  /// 粉丝列表
  Future<Map<String, dynamic>> fansList(
    Map<String, dynamic> params,
  ) async {
    Response res = await Http.get(
      '/api/customer/follow/fans_list',
      params: params,
    );
    return res.data;
  }

  /// 新增粉丝列表
  Future<Map<String, dynamic>> newFansList(
    Map<String, dynamic> params,
  ) async {
    Response res = await Http.get(
      '/api/customer/newly_fans_list',
      params: params,
    );
    return res.data;
  }

  /// 关注
  Future<Map<String, dynamic>> follow(Map data) async {
    Response res = await Http.post('/api/customer/follow/add', data: data);
    return res.data;
  }

  /// 取消关注
  Future<Map<String, dynamic>> unFollow(Map data) async {
    Response res = await Http.post('/api/customer/follow/remove', data: data);
    return res.data;
  }

  /// 用户详情
  Future<Map<String, dynamic>> userInfo() async {
    Response res = await Http.get('/api/customer/info');
    return res.data;
  }

  /// 用户资料
  Future<Map<String, dynamic>> userProfile() async {
    Response res = await Http.get('/api/customer/my_data');
    return res.data;
  }

  /// 修改性别
  Future<Map<String, dynamic>> setGender(Map data) async {
    Response res = await Http.post('/api/customer/set_gender', data: data);
    return res.data;
  }

  /// 修改生日
  Future<Map<String, dynamic>> setBirthday(Map data) async {
    Response res = await Http.post('/api/customer/set_birthday', data: data);
    return res.data;
  }

  /// 修改昵称
  Future<Map<String, dynamic>> setNickname(Map data) async {
    Response res = await Http.post('/api/customer/set_nickname', data: data);
    return res.data;
  }

  /// 修改封面
  Future<Map<String, dynamic>> setCover(Map data) async {
    Response res = await Http.post('/api/customer/set_cover', data: data);
    return res.data;
  }

  /// 修改头像
  Future<Map<String, dynamic>> setAvatar(Map data) async {
    Response res = await Http.post('/api/customer/set_avatar', data: data);
    return res.data;
  }

  /// 修改简介
  Future<Map<String, dynamic>> setIntro(Map data) async {
    Response res = await Http.post('/api/customer/set_intro', data: data);
    return res.data;
  }

  /// 修改所在地
  Future<Map<String, dynamic>> setAddress(Map data) async {
    Response res = await Http.post(
      '/api/customer/set_seat_address',
      data: data,
    );
    return res.data;
  }

  /// 修改唯一号
  Future<Map<String, dynamic>> setUniqueNo(Map data) async {
    Response res = await Http.post('/api/customer/set_unique_no', data: data);
    return res.data;
  }

  /// 修改职业
  Future<Map<String, dynamic>> setJob(Map data) async {
    Response res = await Http.post('/api/customer/set_job', data: data);
    return res.data;
  }

  /// 我的评论列表
  Future<Map<String, dynamic>> myCommentList(
    Map<String, dynamic> params,
  ) async {
    Response res = await Http.get(
      '/api/customer/comment/my_list',
      params: params,
    );
    return res.data;
  }

  /// 某个用户详情
  Future<Map<String, dynamic>> otherUserInfo(
    Map<String, dynamic> params,
  ) async {
    Response res = await Http.get(
      '/api/customer/customer_info',
      params: params,
    );
    return res.data;
  }

  /// 某个用户的帖子列表
  Future<Map<String, dynamic>> otherUserContentList(
    Map<String, dynamic> params,
  ) async {
    Response res = await Http.get(
      '/api/customer/note_list',
      params: params,
    );
    return res.data;
  }

  /// 某个用户的点赞列表
  Future<Map<String, dynamic>> otherUserLikeList(
    Map<String, dynamic> params,
  ) async {
    Response res = await Http.get(
      '/api/customer/give_list',
      params: params,
    );
    return res.data;
  }

  /// 某个用户的评论列表
  Future<Map<String, dynamic>> otherUserCommentList(
    Map<String, dynamic> params,
  ) async {
    Response res = await Http.get(
      '/api/customer/comment_list',
      params: params,
    );
    return res.data;
  }
}
